﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Text;

/// <summary>
///JGTZ 的摘要说明
/// </summary>
public class JGTZ
{
  public JGTZ()
  {
    //
    //TODO: 在此处添加构造函数逻辑
    //
  }

  public static CommandInfo JGTZ_Insert(string id, string qsrq, string jsrq, string czr,string yqxz)
  {
    string sql = "insert into sjlr_jgtzsj values(@0,@1,@2,@3,@4)";
    SqlParameter[] cmdParams = new SqlParameter[5] { new SqlParameter("@0", SqlDbType.VarChar, 10), 
      new SqlParameter("@1", SqlDbType.VarChar, 20),new SqlParameter("@2", SqlDbType.VarChar, 20),
    new SqlParameter("@3", SqlDbType.VarChar, 20),new SqlParameter("@4", SqlDbType.VarChar, 200)};
    cmdParams[0].Value = id;
    cmdParams[1].Value = qsrq;
    cmdParams[2].Value = jsrq;
    cmdParams[3].Value = czr;
    cmdParams[4].Value = yqxz;

    CommandInfo ci = new CommandInfo();
    ci.CommandText = sql;
    ci.Parameters = cmdParams;
    return ci;
  }

  public static DataSet GetRZ()
  {
    StringBuilder sbSql = new StringBuilder();
    sbSql.Append("select a.* from sjlr_jgtzsj a order by id desc");
    //sbSql.Append("order by cx_id desc");
    //SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 10), new SqlParameter("@1", SqlDbType.VarChar, 10) };
    //cmdParams[0].Value = date1;
    //cmdParams[1].Value = date2;
    DataSet ds = DbHelperSQL.Query(sbSql.ToString());
    return ds;
  }
}